package 数组完成房屋租赁系统;

import java.util.Objects;

public class House {
    private int id;//编号
    private String name;//姓名
    private String number;//电话号
    private String address;//地址
    private int  money;//租金
    private String status;//房子状态

    public House() {
    }

    public House(String name, String number, String address, int money, String status) {
        this.id = id;
        this.name = name;
        this.number = number;
        this.address = address;
        this.money = money;
        this.status = status;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public int getMoney() {
        return money;
    }

    public void setMoney(int money) {
        this.money = money;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "House{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", number='" + number + '\'' +
                ", address='" + address + '\'' +
                ", money=" + money +
                ", status='" + status + '\'' +
                '}';
    }
    @Override
    public boolean equals(Object o){
        if (this == o) return true;
        if (!(o instanceof House)) return false;
        House house = (House) o;
        return getId() == house.getId() &&
                getMoney() == house.getMoney() &&
                Objects.equals(getName(), house.getName()) &&
                Objects.equals(getNumber(), house.getNumber()) &&
                Objects.equals(getAddress(), house.getAddress()) &&
                Objects.equals(getStatus(), house.getStatus());
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, number, address, money, status);
    }
}


